package com.indusfo.spc.client.controller;

import com.indusfo.spc.annotation.UserLoginToken;
import com.indusfo.spc.client.pojo.ClientSpcDeteDetail;
import com.indusfo.spc.client.service.ClientSpcDeteDetailService;
import com.indusfo.spc.vo.JSONObject;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhengd
 * @create 2019-12-27
 */
@RestController
@RequestMapping("/client/spcDeteDetail")
public class ClientSpcDeteDetailController {

	@Autowired
	private ClientSpcDeteDetailService clientSpcDeteDetailService;

	/**
	 * 客户端检测值新增
	 * 
	 * @param ClientSpcDeteDetail
	 * @return
	 */
	@PostMapping("/insertClientSpcDeteDetail")
	@UserLoginToken
	public JSONObject insertClientSpcDeteDetail(@RequestBody List<ClientSpcDeteDetail> clientSpcDeteDetails) {
		try {
			return JSONObject.oK(clientSpcDeteDetailService.insertClientSpcDeteDetail(clientSpcDeteDetails));
		} catch (Exception e) {
			return JSONObject.build(JSONObject.ERROR, e.getMessage());
		}
	}

}
